// To parse this JSON data, do
//
//     final provinceModel = provinceModelFromJson(jsonString);

import 'dart:convert';

ProvinceModel provinceModelFromJson(String str) => ProvinceModel.fromJson(json.decode(str));

String provinceModelToJson(ProvinceModel data) => json.encode(data.toJson());

class ProvinceModel {
  ProvinceModel({
    this.id,
    this.parentId,
    this.name,
    this.shortName,
    this.lng,
    this.lat,
    this.sort,
    this.cityList,
    this.areaList,
  });

  int? id;
  int? parentId;
  String? name;
  String? shortName;
  String? lng;
  String? lat;
  int? sort;
  List<ProvinceModel>? cityList;
  List<ProvinceModel>? areaList;

  factory ProvinceModel.fromJson(Map<String, dynamic> json) => ProvinceModel(
        id: json["id"],
        parentId: json["parentId"],
        name: json["name"],
        shortName: json["shortName"],
        lng: json["lng"],
        lat: json["lat"],
        sort: json["sort"],
        cityList: json["cityList"] == null
            ? null
            : List<ProvinceModel>.from(json["cityList"].map((x) => ProvinceModel.fromJson(x))),
        areaList: json["areaList"] == null
            ? null
            : List<ProvinceModel>.from(json["areaList"].map((x) => ProvinceModel.fromJson(x))),
      );

  Map<String, dynamic> toJson() => {
        "id": id,
        "parentId": parentId,
        "name": name,
        "shortName": shortName,
        "lng": lng,
        "lat": lat,
        "sort": sort,
        "cityList": cityList == null ? null : List<dynamic>.from(cityList!.map((x) => x.toJson())),
        "areaList": areaList == null ? null : List<dynamic>.from(areaList!.map((x) => x.toJson())),
      };
//
// @override
// String getSuspensionTag() {
//   // TODO: implement getSuspensionTag
//   return tagIndex;
// }
}
